home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -screenplay- / hd_installers / whdidemos / crionicssilents_hardwired.lha / Hardwired / Install < prev    next >
Text File  |  1998-07-09  |  3KB  |  162 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README") ;name of readme file
  4. (set #last-disk 2)          ;amount of disks
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. ;----------------------------
  22. ; Create disk-Image using DIC
  23. ; IN:  #dest        - DestinationPath
  24. ;      #CI_diskname - DiskName
  25. ;      #CI_diskno   - DiskNumber
  26. ;      #CI_drive    - DriveToReadFrom
  27. ; OUT: -
  28.  
  29. (procedure P_image
  30.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  31.   (if
  32.     (= 0 (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld >con:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno)))
  33.     ("")
  34.     (abort "\"DIC\" has failed to create a diskimage")
  35.   )
  36. )
  37.  
  38. ;****************************
  39.  
  40. (if
  41.   (exists #readme-file)
  42.   (if
  43.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  44.     ("")
  45.     (run ("SYS:Utilities/More %s" #readme-file))
  46.   )
  47. )
  48.  
  49. (set #program "WHDLoad")
  50. (P_chkrun)
  51.  
  52. (set #program "DIC")
  53. (P_chkrun)
  54.  
  55. ; in expert mode ask for source drive
  56. (if
  57.   (= @user-level 2)
  58.   (
  59.     (set #CI_drive
  60.       (askchoice
  61.     (prompt "Select source drive for diskimages")
  62.     (default 0)
  63.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  64.     (help @askchoice-help)
  65.       )
  66.     )
  67.     (if
  68.       (= #CI_drive 0)
  69.       (set #CI_drive "DF0:")
  70.     )
  71.     (if
  72.       (= #CI_drive 1)
  73.       (set #CI_drive "DF1:")
  74.     )
  75.     (if
  76.       (= #CI_drive 2)
  77.       (set #CI_drive "RAD:")
  78.     )
  79.     (if
  80.       (= #CI_drive 3)
  81.       (set #CI_drive
  82.         (askstring
  83.           (prompt "Select source drive for diskimages")
  84.           (default "DF0:")
  85.           (help @askstring-help)
  86.         )
  87.       )
  88.     )
  89.   )
  90.   (
  91.     (set #CI_drive "DF0:")
  92.   )
  93. )
  94.  
  95. (set @default-dest
  96.   (askdir
  97.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  98.     (help @askdir-help)
  99.     (default @default-dest)
  100.     (disk)
  101.   )
  102. )
  103. (set #dest (tackon @default-dest @app-name))
  104. (if
  105.   (exists #dest)
  106.   (
  107.     (set #choice
  108.       (askbool
  109.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  110.         (default 1)
  111.         (choices "Delete" "Skip")
  112.         (help @askbool-help)
  113.       )
  114.     )
  115.     (if
  116.       (= #choice 1)
  117.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  118.     )
  119.   )
  120. )
  121. (makedir #dest
  122.   (help @makedir-help)
  123.   (infos)
  124. )
  125.  
  126. ;----------------------------
  127.  
  128. (copyfiles
  129.   (help @copyfiles-help)
  130.   (source ("%s.slave" @app-name))
  131.   (dest #dest)
  132. )
  133. (copyfiles
  134.   (help @copyfiles-help)
  135.   (source ("%s.inf" @app-name ))
  136.   (newname ("%s.info" @app-name ))
  137.   (dest #dest)
  138. )
  139. (if
  140.   (exists #readme-file)
  141.   (copyfiles
  142.     (help @copyfiles-help)
  143.     (source #readme-file)
  144.     (dest #dest)
  145.   )
  146. )
  147.  
  148. (set #CI_diskno 1)
  149. (while
  150.   (<= #CI_diskno #last-disk)
  151.   (
  152.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  153.     (P_image)
  154.     (set #CI_diskno (+ #CI_diskno 1))
  155.   )
  156. )
  157.  
  158. ;----------------------------
  159.  
  160. (exit)
  161.  
  162.